﻿using System;
using Ue.Framework.Web;
using Ue.Qcdz.Domain.ResourceManager;

namespace Ue.Qcdz.Domain
{
    public partial class SiteUrls
    {
        #region 单例

        private static class SiteUrlHolder
        {
            public static SiteUrls Urls = new SiteUrls();


        }

        public static SiteUrls Instance
        {
            get { return SiteUrlHolder.Urls; }
        }

        #endregion

        private SiteUrls() { }

        #region Helper

        public string BuildUrl(string urlKey, params object[] args)
        {
            SiteUrl url = ResourceGlobals.Instance.GetUrl(urlKey);

            return url == null
                ? "javascript:void(0);"
                : url.BuildUrl(args);
        }

        private string BuildEntityDeleteUrl(string entityEditUrl)
        {
            return UrlHelper.AddUrlQuery(entityEditUrl, "Action", "Delete");
        }

        #endregion
    }
}
